﻿using System.Net;
using System.Net.Sockets;

namespace VirtualKeyboard.Service.TcpServices
{
    internal class AsyncUserToken
    {
        internal IPEndPoint EndPoint { get; set; }

        internal Socket Socket { get; set; }
        internal TcpContext Context { get; private set; }

        internal void Analyse(byte[] buffer, int offset, int length)
        {
            Context = new TcpContext();
            Context.Request = AnalyseHelper.Analyse(buffer,offset,length);
            Context.Request.EndPoint = EndPoint;
        }

        internal void Clear()
        {
            EndPoint = null;
        }
    }
}
